import React from 'react';
import ReactDOM from 'react-dom';
import './index.css';
import App from './App';
import One from './view/one';
import Home from './view/home';
import reportWebVitals from './reportWebVitals';
import { Route, BrowserRouter as Router, Switch } from 'react-router-dom';

// const BrowserRouter = require("react-router-dom").BrowserRouter;

// ReactDOM.render(
//   <React.StrictMode>
//     {/* <BasicRoute/> */}
//     <App />
//   </React.StrictMode>,
//   document.getElementById('root')
// );

function App1() {
  return (
    <div>
      <Switch>
        {/* If the current URL is /about, this route is rendered
            while the rest are ignored */}
        <Route path="/one">
          <One />
        </Route>

        {/* Note how these two routes are ordered. The more specific
            path="/contact/:id" comes before path="/contact" so that
            route will render when viewing an individual contact */}
        {/* <Route path="/contact/:id">
          <Contact />
        </Route>
        <Route path="/contact">
          <AllContacts />
        </Route> */}

        {/* If none of the previous routes render anything,
            this route acts as a fallback.

            Important: A route with path="/" will *always* match
            the URL because all URLs begin with a /. So that's
            why we put this one last of all */}
        <Route path="/">
          <Home />
        </Route>
      </Switch>
    </div>
  );
}
ReactDOM.render(
  // (
  //   <BrowserRouter>
  //     {/* <Route path="/" component={App}/> */}
  //     <Route path="/ok" component={App}/>
  //     <Route path="/one" component={One}/>
  //   </BrowserRouter>
  // ),
  <Router>
    <App />
  </Router>,
  document.getElementById('root')
);

// If you want to start measuring performance in your app, pass a function
// to log results (for example: reportWebVitals(console.log))
// or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals
reportWebVitals();
